<?php
 $fpBootstrap=fopen("bootstrap.css","r");
 $fpXml=fopen("css.xml","a");
 if($fpBootstrap===false && $fpXml==false ) {
	 echo "failta error";
	 exit();
 }

 $count=0;
 $result=array();
 $armount=0;
 while(($str=fgets($fpBootstrap))&&$str !== false){
	 $pattern="/\.[a-zA-Z-]+[0-9a-zA-Z-]+/i";
	 $matchCount=preg_match_all($pattern,$str,$result);
	if($matchCount>0){
		$armount+=$matchCount;
		writeFile($fpXml,$result[0],$matchCount);
		//print_r($result);
		//echo $matchCount."<br>";

	}
	 
 }
 echo $armount;
  $footer="	</AutoComplete>
</NotepadPlus>";
 fputs($fpXml,$footer);
 function writeFile($fP,$datas,$count){
	 for($i=0;$i<$count;$i++){
		 $data="		<KeyWord name=\"$datas[$i]\" />\r\n";
		 fputs($fP,$data);
	 }
	 
 }
